A Compilation Model for Aspect-Oriented Polymorphically Typed Functional Languages
نویسندگان
چکیده
Introducing aspect orientation to a polymorphically typed functional language strengthens the importance of type-scoped advices; i.e., advices with their effects harnessed by type constraints. As types are typically treated as compile time entities, it is highly desirable to be able to perform static weaving to determine at compile time the chaining of type-scoped advices to their associated join points. In this paper, we describe a compilation model, as well as its implementation, that supports static type inference and static weaving of programs in an aspect-oriented polymorphically typed lazy functional language, AspectFun. We present a typedirected weaving scheme that coherently weaves type-scoped advices into the base program at compile time. We state the correctness of the static weaving with respect to the operational semantics of AspectFun. We also demonstrate how control-flow based pointcuts (such as cflowbelow) are compiled away, and highlight several type-directed optimization strategies that can improve the efficiency of woven code.
منابع مشابه
A Compilation Model for Aspect-Oriented Polymorphically Typed Functional Languages (Technical Report)
Introducing aspect orientation to a polymorphically typed functional language strengthens the importance of type-scoped advices; i.e., advices with their effects being harnessed by type constraints. As types are typically treated as compile time entities, it is desirable to be able to perform static weaving to determine at compile time the chaining of type-scoped advices to the invocations of t...
متن کاملType-directed weaving of aspects for polymorphically typed functional languages
Incorporating aspect-oriented paradigm to a polymorphically typed functional language enables the declaration of type-scoped advice, in which the effect of an aspect can be harnessed by introducing possibly polymorphic type constraints to the aspect. The amalgamation of aspect orientation and functional programming enables quick behavioral adaption of functions, clear separation of concerns and...
متن کاملA Typed Intermediate Language for Flow-Directed Compilation
We present a typed intermediate language λ for optimizing compilers for function-oriented and polymorphically typed programming languages (e.g., ML). The language λ is a typed lambda calculus with product, sum, intersection, and union types as well as function types annotated with flow labels. A novel formulation of intersection and union types supports encoding flow information in the typed pr...
متن کاملA Type System and Type Soundness for the Calculus of Aspect-Oriented Programming Languages
The formal study of class of functional and procedure-oriented programming languages is well-defined and uses λ-calculus as the main tool. With the advent of object calculi, the formal study of object-oriented programming languages is also well developed and understood. Since the paradigm of aspect-oriented programming is new, formal theory for the same is under development. The proposed untype...
متن کاملEffective Aspects: A Typed Monadic Embedding of Pointcuts and Advice
Aspect-oriented programming (AOP) aims to enhance modularity and reusability in software systems by offering an abstraction mechanism to deal with crosscutting concerns. However, in most general-purpose aspect languages aspects have almost unrestricted power, eventually conflicting with these goals. In this work we present Effective Aspects: a novel approach to embed the pointcut/advice model o...
متن کامل